package io;

import java.io.File;
import java.io.IOException;

public class Demo1 {
    public static void main(String[] args) throws IOException {


        File file = new File("d:/javacode/test.txt");
        System.out.println(file.exists());
        boolean ret = file.createNewFile();
        System.out.println(ret);

        System.out.println(file.getName());
        System.out.println(file.getParent());
        System.out.println(file.getPath());
        System.out.println(file.getAbsolutePath());
        System.out.println(file.getCanonicalPath());
        System.out.println(file.isDirectory());
        System.out.println(file.isFile());

//        File file1 = new File("d:/javacode/demo");
//        for (String array : file1.list()) {
//            System.out.println(array);
//        }
//        for (File f: file1.listFiles()) {
//            System.out.println(f.getName());
//        }
    }

}
